<?php 
	
	$ssFilter = $this->arrParam['ssFilter'];
	$action_link 	= $this->baseUrl('/admin/producer/filter/type/order');
	
	
	//CREATE SEARCH AREA
	$keywords = $this->formText('keywords',$ssFilter['query'],array('class'=>'txtshort'));
	$linkSearch = $this->baseUrl('/admin/search/index/');
	$btnSearch = $this->formButton('search-now','Search now',
									array('onclick'=>"OnSubmitForm('" . $linkSearch . "')"));
	$linkResetSearch = $this->baseUrl('/admin/search/index/');							
	$btnResetSearch = $this->formButton('clear-keywords','Clear',
									array('onclick'=>"OnSubmitForm('" . $linkResetSearch . "')"));	
	 $strSearch = $keywords . ' ' . $btnSearch . ' ' . $btnResetSearch;																
?>
<form name="appForm" method="post" action="">



                        <?php echo $this->render('product/toolbar/index.php')?>
                        <div class="clr"></div>
                         <?php echo $this->render('product/sublink/index.php')?>

                        <!-- BEGIN: CONTENT -->
                        <div id="element-box">
                            <div class="t">
                                <div class="t">
                                    <div class="t"></div>
                                </div>
                            </div>
                            <div class="m">
                                <!-- BEGIN: ELEMENT BOX -->
								<div id="filters">
									<div style="float:left;">
										<?php 
							             	 $searchForm = new Form_SearchForm(); 
							             	 $searchForm->setAction('/ecommerce/public/admin/search/index'); 
							             	 echo $searchForm; 
							         	?>
									</div>
									
									<div class="clr"></div>
								</div>	

                                <!-- Area 4: In du lieu lay tu database -->
                                <table class="adminlist">
                                    <thead>
                                        <tr>
                                            <th width="43" >
                                            	<input type="checkbox" name="checkbox" id="checkbox" onclick="checkedAll()">
                                           	</th>
                                            <th>Tên sản phẩm</th>
                                            <th width="70">Số lượng tồn</th>
                                            <th width="70">Giá mua</th>
                                            <th width="70">Giá bán</th>
                                            <th width="86">Nhà sản xuất</th>						
                                            <th width="77">Loại sản phẩm</th>
                                            <th width="90">Sửa/Xóa</th>

                                            <th width="34">ID</th>
                                        </tr>
                                    </thead>
									
									<?php if(is_array($this->results) && count($this->results) > 0) { ?>
									<?php 
										foreach($this->results as $result){
											$id 			= $result->product_id;
											$name 			= $result->product;
											$price          = $result->price;
											$quantity       = $result->quantity;
											$cost           = $result->cost;
											$producer = $result->producer;
											$producttype = $result->product_type;
												
											
											$linkEdit		= $this->baseUrl('/admin/producer/edit/id/' . $id);
											$btnEdit		= $this->cmsIconButton('Edit Item',$this->baseUrl('../public/imagesad/icon_edit.png'),$linkEdit);
											
											$linkDelete		= $this->baseUrl('/admin/producer/delete/id/' . $id);
											$btnDelete		= $this->cmsIconButton('Delete Item',$this->baseUrl('../public/imagesad/icon_del.png'),$linkDelete);
										
											$strIconButton	= $btnEdit . ' ' . $btnDelete;
											
											$cid			= $this->formCheckbox('cid[]',$id);
									?>
                                    <tr class="even">						
                                        <td align="center"><?php echo $cid;?></td>
                                        <td align="center"><?php echo $name;?></td>
                                        <td align="center"><?php echo $quantity;?></td>
                                        <td align="center"><?php echo $cost;?></td>
                                        <td align="center"><?php echo $price;?></td>
                                        <td align="center"><?php echo $producer;?></td>

                                        <td align="center"><?php echo $producttype;?></td>
                                        <td align="center"><?php echo $strIconButton;?></td>
                                        <td align="center"><?php echo $id;?></td>
                                    </tr>
                                    <?php 
										}
									}
                                    ?>
                                    <!-- BEGIN: PAGINATION (FOOT) -->
                                    <tfoot>
                                        <tr>
                                            <td colspan="9">
                                                <div class="container">
                                                    <div class="pagination">
                                                        <?php
														/* echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); */
														?>
                                                        <div class="limit"></div>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>					
                                    </tfoot>				<!-- END: PAGINATION (FOOT) -->
                                </table>
                                <!-- Area 4: In du lieu lay tu database - End -->

                                <!-- END: ELEMENT BOX -->	
                              <div class="clr"></div>
                            </div>
                            <div class="b">
                                <div class="b">
                                    <div class="b"></div>
                                </div>
                            </div>
                        </div>
                        <!-- END: 	CONTENT -->
                    </form>
